#include "comm.hpp"
#include <iostream>
#include <string>
using namespace std;
int main()
{
    //写
    int fd=open(FILE_NAME,O_WRONLY);
    cout<<"cliner open"<<endl;

    if(fd<0)
    {perror("open");exit(OPEN_ERR);}
    string line;
    while(true)
    {
    cout<<"please enter@";
    getline(cin,line);
    int num=write(fd,line.c_str(),line.size());
    if(num==-1)
    {
        perror("write");
        exit(WRITE_ERR);
    }
    }
    close(fd);
    return 0;
}